<template>
	<div id="zongfen">
		<ul class="list-group">
            <div v-for="(item,key) in textbook_edition" :key="key">
                <li class="list-group-item">{{item.name}}
                    <div class="styled-select">
            		<span class="pull-right required xia">
            			<img src="../assets/xia.png"/>
            		</span>
                        <select class="book" v-model="school.textbook_edition[key].fraction">
                            <option v-for="(item,index) in textbook_editiondata">{{item.name}}</option>
                        </select>
                    </div>
                </li>
            </div>
	    </ul>
	    <button type="button" @click="save()" class="btn btn-primary btn-lg btn-block">保存</button>
	</div>
</template>

<script>
/* eslint-disable */
export default {
  name: 'zongfen',
  computed: {
    school () {
      	return this.$store.state.system.school
    },
    textbook_editiondata () {
      	return this.$store.state.system.textbook_editiondata
    },
    textbook_edition () {
      	return this.$store.state.system.school.textbook_edition
    }
  },
  created () {
      this.init()  //初始化
  },
  watch: {
      '$route': 'init'
  },
  methods:{
  	init() {
        this.$store.state.system.title =  this.$store.state.system.subject_content.title
        console.log(this.$store.state.system.title)
    },
    save() {
        layer.open({ content: '添加成功！', skin: 'msg', time: 2 });
        this.$router.go(-1);
	}
  }
}
</script>

<style>
	.styled-select {
        display: inline;
        /*width: 1.4rem;*/
        height: 0.5rem;
        overflow: hidden;
        /*margin-left: 3.9rem;*/
    }
	.xia img{
        width: 0.32rem;
        height: 0.32rem;
    }
    .xia{
        margin-right: -0.1rem;
    }
    .book{
        border: none;
        outline: none;
        color: #b0b0b0;
        font-size: 0.3rem;
        width: 5.1rem;
        height: 0.5rem;
        background-color: #fff;
        padding: 0 0 0.05rem 0;
        -webkit-appearance: none; /*for chrome*/
        text-indent: 13em;
    }
    .book::expand { display: none; }
    .btn{
    	border: none!important;
	    outline: none!important;
    }
</style>